<link rel="stylesheet" type="text/css" href="/public/static/css/index.css" />
<script src="/public/static/js/synchro.js"></script>
<{include file="tpl/filter.tpl"}>

<div>
	<{if $is_add == 2 }>
    <a class="label-success pull-right" style="color: #fff; padding: 0 4px;" href="<{PubFunc::buildUrl('/oss/?r=matchCrossServerV/add')}>">
        <i class="fa fa-plus"></i> 添加
    </a>
    <a href="javascript:;" id="formal" name="formal" class="btn" style="margin-left: 10px;margin-bottom: 10px;" data-url="?r=matchCrossServerV/formal">生效</a>
    <{/if}>
	
    
</div>
<{if $is_add == 2 }>
<{include file="tpl/grid.tpl"}>
<{/if}>

<{if $is_add == 1 }>
	<div id="once-filter-openid" class="nav-tabs-custom" style="padding: 15px;">
		<span style="color: red;">还未到预备时间</span>
    </div>
<{/if}>
	
<script type="text/javascript">
	  
        $(document).on('click','a[name="formal"]',function(){
        	var id = 0;
        	var loading = null;
        	layer.confirm('确定生效配置的数据!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        	}, function(){
        	        var data_url = $("#formal").attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    uploading = layer.load(1, {shade: [0.4, '#393D49']});
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'id':id},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });	
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });
                    
        	    }, function(){
        			//取消
        		});
        });
</script>
	
